package r_Inst;

import mips.Decoder;
import mips.PC;

public class Jr {
	public static void jr(int source){
		System.out.println("PC value now is : " +Decoder.toBinary(PC.pc)); 
		System.out.println("PC value :"+ Decoder.toBinary(PC.pc)+" sent to The instruction memory to read address..");		
		System.out.println("Instuction memory sending Instruction[31:26] to CONTROL,Instruction[31:26] having the value '000010'");
		System.out.println("CONTROL sends RegWrite of 0 to Registers");
		System.out.println("CONTROL sends MemRead of 0 to DataMemory");
		System.out.println("CONTROL sends MemWrite of 0 to DataMemory");
		System.out.println("Instuction memory sending Instruction[25:21] : "+Decoder.AddzerostoLeft(Decoder.toBinary(source)+"",5)+" to Registers @ read Register1");
		System.out.println("CONTROL sends Jump of 10 to mux");
		System.out.println("mux choose the Pc value from a wire connected from Read data 1 to the mux");
		PC.jumpRegerster(source);
		System.out.println("The new PC value : " + Decoder.toBinary(PC.pc));
		System.out.println("------------------------------------");
	}
}
